<template>
  <div class="reportFormPage">
    <topOperation />
    <div id="domid">
      <el-row>
        <el-col :span="5" :offset="19">
          <div class="pageNumBox">第 1 页，共 1 页</div>
        </el-col>
      </el-row>
      <div class="topTwoBox">
        <div class="centerName">水泥胶砂流动度、胶砂强度试验检测记录表</div>
        <div class="codeText">JGLQ04006<br>JGLQ04009</div>
      </div>
      <div class="threeTopBox">
        <div class="threeItem1">检测单位名称：</div>
        <div class="threeItem2">
          山东高速路桥工程试验检测有限公司
        </div>
        <div class="threeItem3">
          记录编号：JL-JGT-LJ5-050-1
        </div>
      </div>
      <!------------------------------表头-------------------------->
      <table border="1" height="110px" bordercolor="#000000" cellpadding="2" cellspacing="0" align="center">
        <tbody>
        <tr>
          <td height="25" align="center" width="15%">工程名称</td>
          <td style="word-wrap: break-word; word-break :break-all;" colspan="3" bgcolor="#ffffff">
            <el-input type="text" v-model="oneTableData.a"
                      style="border-width:0px;height:100%;width:100%;text-align:left;" />
          </td>
        </tr>
        <tr>
          <td height="25" align="center">工程部位/用途</td>
          <td style="word-wrap: break-word; word-break :break-all;" colspan="3" bgcolor="#ffffff">
            <el-input type="text" v-model="oneTableData.a"
                      style="border-width:0px;height:100%;width:100%;text-align:left;" />
          </td>
        </tr>
        <tr>
          <td height="40" align="center">样品信息</td>
          <td style="word-wrap: break-word; word-break :break-all;" bgcolor="#ffffff" colspan="3">
            <div style="width:100%;background-color:white;">样品名称：普通硅酸盐水泥；样品编号：YP(DL)-2024-SNJ-001；样品数量：20kg；<br>样品状态： 灰色，干燥、无结块；来样时间：2024年01月14日 </div>
          </td>
        </tr>
        <tr>
          <td height="25" align="center">试验检测日期</td>
          <td bgcolor="#ffffff">
            <div style="width:218px;background-color:white;word-wrap: break-word; word-break :break-all;">2024-01-15～2024-01-16</div>
          </td>
          <td align="center">试验条件</td>
          <td bgcolor="#ffffff">
            <el-input type="text" v-model="oneTableData.b" style="border-width:0px;height:100%;width:100%;text-align:left;" />
          </td>
        </tr>
        <tr>
          <td height="25" align="center">检测依据</td>
          <td bgcolor="#ffffff">
            <div style="width:218px;background-color:white;word-wrap: break-word; word-break :break-all;">JTG
              3430-2020
            </div>
          </td>
          <td align="center">判定依据</td>
          <td bgcolor="#ffffff">
            <el-input type="text" v-model="oneTableData.b"
                      style="border-width:0px;height:100%;width:100%;text-align:left;" />
          </td>
        </tr>
        <tr>
          <td height="40" align="center">主要仪器设备<br>名称及编号</td>
          <td colspan="3" bgcolor="#ffffff">
            <div style="width:100%;background-color:white;">
              □水泥净浆搅拌机/SN-01、□维卡仪/SN-03、□电子天平/SN-34、 □雷氏夹测定仪/SN-07、□沸煮箱/SN-05等</div>
          </td>
        </tr>

        </tbody>
      </table>
      <!------------------------------胶砂流动性-------------------------->
      <table cellpadding="1" cellspacing="0" bordercolor="#000000"
             style="border-right: 2px solid black; border-top: none; border-left: 2px solid black; border-bottom: 2px solid black; border-collapse: collapse;  height: 100px; text-align: center;"
             align="center" border="1" tbindex="0">
        <tbody>
        <tr height="25">
          <td colspan="8" >胶砂流动度</td>

        </tr>
        <tr height="40">
          <td style="width: 5%" >试验次数</td>
          <td style="width: calc(95% / 7);">水泥用量<br>(g)</td>
          <td style="width: calc(95% / 7);">标准砂用量<br>(g)</td>
          <td style="width: calc(95% / 7);">用水量<br>(g)</td>
          <td style="width: calc(95% / 7);">扩展直径<br>(mm)</td>
          <td style="width: calc(95% / 7);">垂直直径<br>(mm)</td>
          <td style="width: calc(95% / 7);">胶砂流动度<br>测值(mm)</td>
          <td style="width: calc(95% / 7);">胶砂流动度<br>测定值(mm)</td>
        </tr>
        <tr height="25">
          <td></td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
        </tr>
        </tbody>
      </table>
      <!------------------------------胶砂强度-------------------------->
      <table cellpadding="1" cellspacing="0" bordercolor="#000000"
             style="border-right: 2px solid black; border-top: none; border-left: 2px solid black; border-bottom: 2px solid black; border-collapse: collapse;  height: 200px; text-align: center;"
             align="center" border="1" tbindex="0">
        <tbody>
        <tr height="25">
          <td colspan="7">胶砂强度</td>
        </tr>
        <tr height="25">
          <td colspan="2">养护条件</td>
          <td colspan="2"></td>
          <td >成型日期</td>
          <td colspan="2"></td>
        </tr>
        <tr height="25">
          <td width="5%" rowspan="7">抗折强度</td>
          <td width="5%">龄期(d)</td>
          <td style="width: calc(90% / 5);">试验日期</td>
          <td style="width: calc(90% / 5);">试件尺寸(mm)</td>
          <td style="width: calc(90% / 5);">破坏荷载(N)</td>
          <td style="width: calc(90% / 5);">单值(Mpa)</td>
          <td style="width: calc(90% / 5);">平均值(Mpa)</td>
        </tr>
        <tr height="25">
          <td rowspan="3">3</td>
          <td rowspan="3"></td>
          <td rowspan="3">40*40*160</td>
          <td></td>
          <td></td>
          <td rowspan="3"></td>
        </tr>
        <tr height="25">
          <td></td>
          <td></td>
        </tr>
        <tr height="25">
          <td></td>
          <td></td>
        </tr>
        <tr height="25">
          <td rowspan="3">28</td>
          <td rowspan="3"></td>
          <td rowspan="3">40*40*160</td>
          <td></td>
          <td></td>
          <td rowspan="3"></td>
        </tr>
        <tr height="25">
          <td></td>
          <td></td>
        </tr>
        <tr height="25">
          <td></td>
          <td></td>
        </tr>


        <tr height="25">
          <td  rowspan="13">抗压强度</td>
          <td>龄期(d)</td>
          <td>试验日期</td>
          <td>试件尺寸(mm)</td>
          <td>破坏荷载(kN)</td>
          <td>单值(Mpa)</td>
          <td>平均值(Mpa)</td>
        </tr>
        <tr height="25">
          <td rowspan="6">3</td>
          <td rowspan="6"></td>
          <td rowspan="6">1600</td>
          <td></td>
          <td></td>
          <td rowspan="6"></td>
        </tr>
        <tr height="25">
          <td></td>
          <td></td>
        </tr>
        <tr height="25">
          <td></td>
          <td></td>
        </tr>
        <tr height="25">
          <td></td>
          <td></td>
        </tr>
        <tr height="25">
          <td></td>
          <td></td>
        </tr>
        <tr height="25">
          <td></td>
          <td></td>
        </tr>
        <tr height="25">
          <td rowspan="6">28</td>
          <td rowspan="6"></td>
          <td rowspan="6">1600</td>
          <td></td>
          <td></td>
          <td rowspan="6"></td>
        </tr>
        <tr height="25">
          <td></td>
          <td></td>
        </tr>
        <tr height="25">
          <td></td>
          <td></td>
        </tr>
        <tr height="25">
          <td></td>
          <td></td>
        </tr>
        <tr height="25">
          <td></td>
          <td></td>
        </tr>
        <tr height="25">
          <td></td>
          <td></td>
        </tr>

        </tbody>
      </table>
      <!------------------------------附加声明-------------------------->
      <table cellpadding="1" cellspacing="0" bordercolor="#000000" width="100%"
             style="border-right: 2px solid black; border-top: none; border-left: 2px solid black; border-bottom: 2px solid black; border-collapse: collapse;  height: 60px; text-align: center;"
             align="center" border="1" tbindex="0">
        <tbody>
        <tr height="60">
          <td width="100%" align="left" valign="top">附加声明：</td>
        </tr>
        </tbody>
      </table>
      <!------------------------------底部-------------------------->
      <table border="0" cellpadding="0" cellspacing="0" align="center"
             style="width: 100%; border-collapse:collapse;height:22px;">
        <tbody>
        <tr>
          <td width="10%" align="right">检测：</td>
          <td width="15%" align="left"></td>
          <td width="10%" align="right">审核：</td>
          <td width="15%" align="left"></td>
          <td width="10%" align="right">批准：</td>
          <td align="left" width="15%"></td>
          <td width="10%">日期：</td>
          <td align="left" width="15%">
            <el-input type="text" v-model="dateText" :readonly="readonly" style="height:20px;width:110px;" />
          </td>
        </tr>
        </tbody>
      </table>
    </div>
  </div>
</template>

<script>
import { listSnjsjcjlbBsInfo, getSnjsjcjlbBsInfo, delSnjsjcjlbBsInfo, addSnjsjcjlbBsInfo, updateSnjsjcjlbBsInfo } from "@/api/report_sn/snjsjcjlbBsInfo";
import topOperation from "@/views/reportForms/components/topOperation";

export default {
  name: "SnjsjcjlbBsInfo",
  data() {
    return {
      oneTableData: {
        a: 'K39+820-K40+440原地面',
        b: 'JTG/T 3610-2019',
        c: '2022年03月09日',
        d: 'K40 + 406',
        e: '/',
      },
      twoTableData: {
        a1: '＜5',
        a2: '重型II - 1',
        a3: '997',
        a4: '4.5',
        a5: '40',
        a6: '/',
        a7: '/',
        a8: '/',
        a9: '7.8',
        a10: '9.6',
        a11: '11.8',
        a12: '14.2',
        a13: '16.5',
        a14: '/',
        a15: '1.75',
        a16: '1.86',
        a17: '1.89',
        a18: '1.85',
        a19: '1.75',
        a20: '/',
        a21: '7.6',
        a22: '9.4',
        a23: '11.6',
        a24: '14.8',
        a25: '16.6',
        a26: '/',
        a27: '1.73',
        a28: '1.84',
        a29: '1.89',
        a30: '1.82',
        a31: '1.74',
        a32: '/',
        a33: '11.6',
        a34: '1.89',
        a35: '11.5',
        a36: '1.89',
        a37: '11.7',
        a38: '1.89',
      },
      fjsm: '附加声明：/',
      dateText: '2024年05月10日',
      readonly: false,
      // 按钮loading
      buttonLoading: false,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 水泥胶砂流动度、胶砂强度试验检测记录表格数据
      snjsjcjlbBsInfoList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        page: undefined,
        totalPage: undefined,
        jiancdwmc: undefined,
        jilbh: undefined,
        gongcbwyt: undefined,
        yangpmc: undefined,
        yangpbh: undefined,
        yangpsl: undefined,
        yangpzt: undefined,
        yangpsj: undefined,
        shiyjcrq: undefined,
        shiytjwd: undefined,
        shiytjsd: undefined,
        jiancyj: undefined,
        pandyj: undefined,
        zhuyyqsbmcjbh: undefined,
        jiaoslddsycs: undefined,
        jiaoslddsnyl: undefined,
        jiaoslddbzsyl: undefined,
        jiaoslddysl: undefined,
        jiaoslddkzzj: undefined,
        jiaoslddczzj: undefined,
        jiaoslddjslddcdz: undefined,
        jiaosqdyhtj: undefined,
        jiaosldcxrq: undefined,
        jiaosldkzqdlq3: undefined,
        jiaosldkzqdlq28: undefined,
        jiaosldkyqdlq3: undefined,
        jiaosldkyqdlq28: undefined,
        fujsm: undefined,
        jianc: undefined,
        jil: undefined,
        fuh: undefined,
        riq: undefined,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        excelId: [
          { required: true, message: "不能为空", trigger: "blur" }
        ],
        page: [
          { required: true, message: "第几页不能为空", trigger: "blur" }
        ],
        totalPage: [
          { required: true, message: "共几页不能为空", trigger: "blur" }
        ],
        jiancdwmc: [
          { required: true, message: "检测单位名称不能为空", trigger: "blur" }
        ],
        jilbh: [
          { required: true, message: "记录编号不能为空", trigger: "blur" }
        ],
        gongcbwyt: [
          { required: true, message: "工程部位/用途不能为空", trigger: "blur" }
        ],
        yangpmc: [
          { required: true, message: "样品名称不能为空", trigger: "blur" }
        ],
        yangpbh: [
          { required: true, message: "样品编号不能为空", trigger: "blur" }
        ],
        yangpsl: [
          { required: true, message: "样品数量不能为空", trigger: "blur" }
        ],
        yangpzt: [
          { required: true, message: "样品状态不能为空", trigger: "blur" }
        ],
        yangpsj: [
          { required: true, message: "样品时间不能为空", trigger: "blur" }
        ],
        shiyjcrq: [
          { required: true, message: "试验检测日期不能为空", trigger: "blur" }
        ],
        shiytjwd: [
          { required: true, message: "试验条件温度不能为空", trigger: "blur" }
        ],
        shiytjsd: [
          { required: true, message: "试验条件湿度不能为空", trigger: "blur" }
        ],
        jiancyj: [
          { required: true, message: "检测依据不能为空", trigger: "blur" }
        ],
        pandyj: [
          { required: true, message: "判定依据不能为空", trigger: "blur" }
        ],
        zhuyyqsbmcjbh: [
          { required: true, message: "主要仪器设备名称及编号不能为空", trigger: "blur" }
        ],
        jiaoslddsycs: [
          { required: true, message: "胶砂流动度-试验次数不能为空", trigger: "blur" }
        ],
        jiaoslddsnyl: [
          { required: true, message: "胶砂流动度-水泥用量(g)不能为空", trigger: "blur" }
        ],
        jiaoslddbzsyl: [
          { required: true, message: "胶砂流动度-标准砂用量(g)不能为空", trigger: "blur" }
        ],
        jiaoslddysl: [
          { required: true, message: "胶砂流动度-用水量(min)不能为空", trigger: "blur" }
        ],
        jiaoslddkzzj: [
          { required: true, message: "胶砂流动度-扩展直径(mm)不能为空", trigger: "blur" }
        ],
        jiaoslddczzj: [
          { required: true, message: "胶砂流动度-垂直直径(mm)不能为空", trigger: "blur" }
        ],
        jiaoslddjslddcz: [
          { required: true, message: "胶砂流动度-胶砂流动度测值(mm)不能为空", trigger: "blur" }
        ],
        jiaoslddjslddcdz: [
          { required: true, message: "胶砂流动度-胶砂流动度测定值(mm)不能为空", trigger: "blur" }
        ],
        jiaosqdyhtj: [
          { required: true, message: "胶砂强度-养护条件不能为空", trigger: "blur" }
        ],
        jiaosldcxrq: [
          { required: true, message: "胶砂强度-成型日期不能为空", trigger: "blur" }
        ],
        jiaosldkzqdlq3: [
          { required: true, message: "胶砂强度-抗折强度龄期3不能为空", trigger: "blur" }
        ],
        jiaosldkzqdlq28: [
          { required: true, message: "胶砂强度-抗折强度龄期28不能为空", trigger: "blur" }
        ],
        jiaosldkyqdlq3: [
          { required: true, message: "胶砂强度-抗压强度龄期3不能为空", trigger: "blur" }
        ],
        jiaosldkyqdlq28: [
          { required: true, message: "胶砂强度-抗压强度龄期28不能为空", trigger: "blur" }
        ],
        fujsm: [
          { required: true, message: "附加声明不能为空", trigger: "blur" }
        ],
        jianc: [
          { required: true, message: "检测不能为空", trigger: "blur" }
        ],
        jil: [
          { required: true, message: "记录不能为空", trigger: "blur" }
        ],
        fuh: [
          { required: true, message: "复核不能为空", trigger: "blur" }
        ],
        riq: [
          { required: true, message: "日期不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
    this.getList();
  },
  components: {
    topOperation
  },
  methods: {
    /** 查询水泥胶砂流动度、胶砂强度试验检测记录列表 */
    getList() {
      this.loading = true;
      listSnjsjcjlbBsInfo(this.queryParams).then(response => {
        this.snjsjcjlbBsInfoList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        excelId: undefined,
        page: undefined,
        totalPage: undefined,
        jiancdwmc: undefined,
        jilbh: undefined,
        gongcbwyt: undefined,
        yangpmc: undefined,
        yangpbh: undefined,
        yangpsl: undefined,
        yangpzt: undefined,
        yangpsj: undefined,
        shiyjcrq: undefined,
        shiytjwd: undefined,
        shiytjsd: undefined,
        jiancyj: undefined,
        pandyj: undefined,
        zhuyyqsbmcjbh: undefined,
        jiaoslddsycs: undefined,
        jiaoslddsnyl: undefined,
        jiaoslddbzsyl: undefined,
        jiaoslddysl: undefined,
        jiaoslddkzzj: undefined,
        jiaoslddczzj: undefined,
        jiaoslddjslddcz: undefined,
        jiaoslddjslddcdz: undefined,
        jiaosqdyhtj: undefined,
        jiaosldcxrq: undefined,
        jiaosldkzqdlq3: undefined,
        jiaosldkzqdlq28: undefined,
        jiaosldkyqdlq3: undefined,
        jiaosldkyqdlq28: undefined,
        fujsm: undefined,
        jianc: undefined,
        jil: undefined,
        fuh: undefined,
        riq: undefined,
        delFlag: undefined,
        createBy: undefined,
        createTime: undefined,
        updateBy: undefined,
        updateTime: undefined
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.excelId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加水泥胶砂流动度、胶砂强度试验检测记录";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.loading = true;
      this.reset();
      const excelId = row.excelId || this.ids
      getSnjsjcjlbBsInfo(excelId).then(response => {
        this.loading = false;
        this.form = response.data;
        this.open = true;
        this.title = "修改水泥胶砂流动度、胶砂强度试验检测记录";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.buttonLoading = true;
          if (this.form.excelId != null) {
            updateSnjsjcjlbBsInfo(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            }).finally(() => {
              this.buttonLoading = false;
            });
          } else {
            addSnjsjcjlbBsInfo(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            }).finally(() => {
              this.buttonLoading = false;
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const excelIds = row.excelId || this.ids;
      this.$modal.confirm('是否确认删除水泥胶砂流动度、胶砂强度试验检测记录编号为"' + excelIds + '"的数据项？').then(() => {
        this.loading = true;
        return delSnjsjcjlbBsInfo(excelIds);
      }).then(() => {
        this.loading = false;
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {
      }).finally(() => {
        this.loading = false;
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('report_lq/snjsjcjlbBsInfo/export', {
        ...this.queryParams
      }, `snjsjcjlbBsInfo_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>

<style scoped lang="scss">
@import url('../../reportForms/style/reportForm.scss');
</style>
